home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / ada / gnat1792.zip / gnat179b / t-adainc / s-unstyp.ads < prev    next >
Text File  |  1994-05-19  |  6KB  |  175 lines

  1. ------------------------------------------------------------------------------
  2. --                                                                          --
  3. --                          GNAT RUNTIME COMPONENTS                         --
  4. --                                                                          --
  5. --                S Y S T E M . U N S I G N E D _ T Y P E S                 --
  6. --                                                                          --
  7. --                                 S p e c                                  --
  8. --                                                                          --
  9. --                            $Revision: 1.1 $                              --
  10. --                                                                          --
  11. --           Copyright (c) 1992,1993,1994 NYU, All Rights Reserved          --
  12. --                                                                          --
  13. -- GNAT is free software;  you can  redistribute it  and/or modify it under --
  14. -- terms of the  GNU General Public License as published  by the Free Soft- --
  15. -- ware  Foundation;  either version 2,  or (at your option) any later ver- --
  16. -- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
  17. -- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
  18. -- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License --
  19. -- for  more details.  You should have  received  a copy of the GNU General --
  20. -- Public License  distributed with GNAT;  see file COPYING.  If not, write --
  21. -- to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. --
  22. --                                                                          --
  23. ------------------------------------------------------------------------------
  24.  
  25. --  This package contains definitions of standard unsigned types that
  26. --  correspond in size to the standard signed types declared in Standard.
  27. --  and (unlike the types in Interfaces have corresponding names).
  28.  
  29. package System.Unsigned_Types is
  30.  
  31.    type Short_Short_Unsigned is mod 2 ** Short_Short_Integer'Size;
  32.    type Short_Unsigned       is mod 2 ** Short_Integer'Size;
  33.    type Unsigned             is mod 2 ** Integer'Size;
  34.    type Long_Unsigned        is mod 2 ** Long_Integer'Size;
  35.    type Long_Long_Unsigned   is mod 2 ** Long_Long_Integer'Size;
  36.  
  37.    function Shift_Left
  38.      (Value  : Short_Short_Unsigned;
  39.       Amount : Natural)
  40.      return    Short_Short_Unsigned;
  41.  
  42.    function Shift_Right
  43.      (Value  : Short_Short_Unsigned;
  44.       Amount : Natural)
  45.       return   Short_Short_Unsigned;
  46.  
  47.    function Shift_Right_Arithmetic
  48.      (Value  : Short_Short_Unsigned;
  49.       Amount : Natural)
  50.       return   Short_Short_Unsigned;
  51.  
  52.    function Rotate_Left
  53.      (Value  : Short_Short_Unsigned;
  54.       Amount : Natural)
  55.       return   Short_Short_Unsigned;
  56.  
  57.    function Rotate_Right
  58.      (Value  : Short_Short_Unsigned;
  59.       Amount : Natural)
  60.       return   Short_Short_Unsigned;
  61.  
  62.    function Shift_Left
  63.      (Value  : Short_Unsigned;
  64.       Amount : Natural)
  65.      return    Short_Unsigned;
  66.  
  67.    function Shift_Right
  68.      (Value  : Short_Unsigned;
  69.       Amount : Natural)
  70.       return   Short_Unsigned;
  71.  
  72.    function Shift_Right_Arithmetic
  73.      (Value  : Short_Unsigned;
  74.       Amount : Natural)
  75.       return   Short_Unsigned;
  76.  
  77.    function Rotate_Left
  78.      (Value  : Short_Unsigned;
  79.       Amount : Natural)
  80.       return   Short_Unsigned;
  81.  
  82.    function Rotate_Right
  83.      (Value  : Short_Unsigned;
  84.       Amount : Natural)
  85.       return   Short_Unsigned;
  86.  
  87.    function Shift_Left
  88.      (Value  : Unsigned;
  89.       Amount : Natural)
  90.      return    Unsigned;
  91.  
  92.    function Shift_Right
  93.      (Value  : Unsigned;
  94.       Amount : Natural)
  95.       return   Unsigned;
  96.  
  97.    function Shift_Right_Arithmetic
  98.      (Value  : Unsigned;
  99.       Amount : Natural)
  100.       return   Unsigned;
  101.  
  102.    function Rotate_Left
  103.      (Value  : Unsigned;
  104.       Amount : Natural)
  105.       return   Unsigned;
  106.  
  107.    function Rotate_Right
  108.      (Value  : Unsigned;
  109.       Amount : Natural)
  110.       return   Unsigned;
  111.  
  112.    function Shift_Left
  113.      (Value  : Long_Unsigned;
  114.       Amount : Natural)
  115.      return    Long_Unsigned;
  116.  
  117.    function Shift_Right
  118.      (Value  : Long_Unsigned;
  119.       Amount : Natural)
  120.       return   Long_Unsigned;
  121.  
  122.    function Shift_Right_Arithmetic
  123.      (Value  : Long_Unsigned;
  124.       Amount : Natural)
  125.       return   Long_Unsigned;
  126.  
  127.    function Rotate_Left
  128.      (Value  : Long_Unsigned;
  129.       Amount : Natural)
  130.       return   Long_Unsigned;
  131.  
  132.    function Rotate_Right
  133.      (Value  : Long_Unsigned;
  134.       Amount : Natural)
  135.       return   Long_Unsigned;
  136.  
  137.    function Shift_Left
  138.      (Value  : Long_Long_Unsigned;
  139.       Amount : Natural)
  140.      return    Long_Long_Unsigned;
  141.  
  142.    function Shift_Right
  143.      (Value  : Long_Long_Unsigned;
  144.       Amount : Natural)
  145.       return   Long_Long_Unsigned;
  146.  
  147.    function Shift_Right_Arithmetic
  148.      (Value  : Long_Long_Unsigned;
  149.       Amount : Natural)
  150.       return   Long_Long_Unsigned;
  151.  
  152.    function Rotate_Left
  153.      (Value  : Long_Long_Unsigned;
  154.       Amount : Natural)
  155.       return   Long_Long_Unsigned;
  156.  
  157.    function Rotate_Right
  158.      (Value  : Long_Long_Unsigned;
  159.       Amount : Natural)
  160.       return   Long_Long_Unsigned;
  161.  
  162.    pragma Convention (Intrinsic, Shift_Left);
  163.    pragma Convention (Intrinsic, Shift_Right);
  164.    pragma Convention (Intrinsic, Shift_Right_Arithmetic);
  165.    pragma Convention (Intrinsic, Rotate_Left);
  166.    pragma Convention (Intrinsic, Rotate_Right);
  167.  
  168.    pragma Import (Intrinsic, Shift_Left);
  169.    pragma Import (Intrinsic, Shift_Right);
  170.    pragma Import (Intrinsic, Shift_Right_Arithmetic);
  171.    pragma Import (Intrinsic, Rotate_Left);
  172.    pragma Import (Intrinsic, Rotate_Right);
  173.  
  174. end System.Unsigned_Types;
  175.